layui.use(['table','layer','form','laydate','common'], function(){
	var table = layui.table,
	layer = layui.layer,
	laydate = layui.laydate,
	common = layui.common,
	form = layui.form;

	/*开始时间*/
	laydate.render({
	  	elem: '#start' //指定元素
	});
	/*结束时间*/
	laydate.render({
	  	elem: '#end' //指定元素
	});
	/*@初始化table*/
	var tableObj = table.render({
	    elem: '#table-list',
	    url: '/log/operlog/index', //数据接口
	    id: 'table_list',
	    page: true, //开启分页
	    cols: [[ //表头
	    	{field: 'id', title: '序号'},
	    	{field: 'addtime', title: '操作时间'},
	    	{field: 'admin_sn', title: '操作者'},
	    	{field: 'nkname', title: '操作员工'},
	    	{field: 'event', title: '操作类型'},
	    	{field: 'content', title: '操作事件'},
	    ]],
	    /*渲染前，请求成功后回调*/
	    parseData: function(res){
	    	console.log(res)
	    	if(res.code === 0){
	    		var num = (res.page-1) * res.row
		    	for(var i = 0;i < res.data.length;++i){
		    		res.data[i].id = num + i + 1
		    	}
		    	exportData = res.data
	    	}
	    }
	});
	/*@导出数据处理*/
	common.list.handleData = function(res){
		for(var i = 0;i < res.data.length;++i){
    		res.data[i].id = i + 1
    	}
    	return res.data
	}
	/*@查询*/
	common.list.search('search', tableObj)
	/*@导出*/
	common.list.excel('export', '/log/operlog/index', tableObj, '操作日志', 'xls')

})